package com.dhl.responseibilitychain.approver;

import com.dhl.responseibilitychain.PurchaseRequest;

/**
 * @title: DepartmentApporver
 * @Author danghailiang
 * @Date: 2022/8/24 1:53
 * @Version 1.0
 */
public class DepartmentApporver extends Approver{

    public DepartmentApporver(String name) {
        super(name);
    }

    @Override
    public void processRequest(PurchaseRequest purchaseRequest) {
        float price = purchaseRequest.getPrice();
        if(0 <= price && price <=10000){
            System.out.println( getName() +  "进行进行审批");
        }else{
            // 下一级进行审批
            super.getApprover().processRequest(purchaseRequest);
        }
    }
}
